<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=640,target-densitydpi=device-dpi,maximum-scale=1.0, user-scalable=no">
		<title>index</title>
		<link rel="stylesheet" type="text/css" href="css/common/common.css" />
		<link rel="stylesheet" type="text/css" href="css/index.css" />
	</head>

	<body>
		<div class="loading">
			<img src="img/index/1392662591495_1140x0.gif"/>
		</div>

		<!--背景-->
		<div class="beijing">

			<!--标题-->
			<div class="title"><img src="img/index/index_title.png" /></div>

			<!--开始按钮-->
			<div class="start"><img src="img/index/play_btn.png" />
				<a href="page/game/game.html"></a>
			</div>

			<!--补充能量-->
			<div class="buchong">
				<a href="http://lpl.qq.com/es/2017worlds/?ADTAG=lolweb.v2.act"><img src="img/index/buchong_btn.png" /></a>
			</div>

			<!--游戏说明-->
			<div class="info"><img src="img/index/gameinfo_btn.png" class="info_img" /></div>

			<div class="tanchuang"><img src="img/index/game_info.png" /></div>

			<audio src="music/music.mp3" id="music"></audio>

		</div>

		<script src="js/jquery-2.1.js"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

		<script>

			//自动播放
			function autoPlayAudio() {
				wx.config({
					// 配置信息, 即使不正确也能使用 wx.ready
					debug: false,
					appId: '',
					timestamp: 1,
					nonceStr: '',
					signature: '',
					jsApiList: []
				});
				wx.ready(function() {
					var globalAudio = document.getElementById("music");
					globalAudio.play();
				});
			};
			// 解决ios音乐不自动播放的问题
			autoPlayAudio();

			var beijing = document.getElementsByClassName("beijing")[0];
			var info = beijing.getElementsByClassName("info")[0];
			var info_img = info.getElementsByClassName("info_img")[0];
			var tanchuang = beijing.getElementsByClassName("tanchuang")[0];

			//				说明点击事件
			info_img.addEventListener("click", function(e) {
				if(!tanchuang.classList.contains("tanchuang_1")) {
					tanchuang.classList.add("tanchuang_1");
				} else {
					tanchuang.classList.remove("tanchuang_1");
				}
			})
			
			
			//假的loading
			var loading = document.getElementsByClassName("loading")[0];
			var daotime = 3;
			function daojishi(){
				setInterval(daoTime,1000);
			}
			daojishi();
			function daoTime(){
				daotime -= 1;
				if(daotime<=0){
					loading.style.display = "none";
					beijing.style.display = "flex";
				}
			}
		</script>

	</body>

</html>